/**
 * 
 */
package com.mvity.framework.common.dao;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Session;

import com.mvity.framework.common.base.BaseEntity;

/**
 * @author vity
 * @date 2012-7-23
 * @mail vity.1215@gmail.com
 */
public interface BaseHibernateDao {

	public abstract Session getSession();

	public abstract <T extends BaseEntity> T save(T model);

	public abstract <T extends BaseEntity> T saveOrUpdate(T model);

	public abstract <T extends BaseEntity> void update(T model);

	public abstract <T extends BaseEntity> void merge(T model);

	public abstract <T extends BaseEntity, PK extends Serializable> void remove(Class<T> entityClass, PK id);

	public abstract <T extends BaseEntity> void removeObject(T model);

	public abstract <T extends BaseEntity, PK extends Serializable> void delete(Class<T> entityClass, PK id);

	public abstract <T extends BaseEntity> void deleteObject(T model);

	public abstract <T extends BaseEntity, PK extends Serializable> T get(Class<T> entityClass, PK id);

	public abstract <T extends BaseEntity> int countAll(Class<T> entityClass);

	public abstract <T extends BaseEntity> List<T> listAll(Class<T> entityClass);

}
